﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/MVCFoto.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="registerTitle" ContentPlaceHolderID="TitleContent" runat="server">
    加入<%=MVCFoto.BLL.MVCFotoSettings.SiteName %>
</asp:Content>
<asp:Content ID="registerJS" ContentPlaceHolderID="MetaContent" runat="server">
<script type="text/javascript" language="javascript" src="<%=ResolveUrl("~/Scripts/jquery-1.3.2.min.js")%>"></script>
<script type="text/javascript" language="javascript" src="<%=ResolveUrl("~/Scripts/jquery.validate.pack.js")%>"></script>
<script language="javascript" type="text/javascript">
    var _URL_VALIDATE_USERNAME = '<%=Url.RouteUrl("Ajax",new{action="ValidateUsername"}) %>'; var _URL_VALIDATE_EMAIL = '<%=Url.RouteUrl("Ajax",new{action="ValidateEmail"}) %>';
    var _IMG_CAPTCHA = '<%=Url.RouteUrl("Ajax",new{action="Captcha"}) %>';
</script>
<script type="text/javascript" language="javascript" src="<%=ResolveUrl("~/Scripts/register.js")%>"></script>

</asp:Content>
<asp:Content ID="registerContent" ContentPlaceHolderID="MainContent" runat="server">

    <h2>创建新帐号</h2>
    <p>
        即刻建立您在<%=MVCFoto.BLL.MVCFotoSettings.SiteName %>的新帐号. 您已有帐号了? <%= Html.ActionLink("立即登录", "LogOn") %> 
    </p>
    <p>
        密码最少<%=Html.Encode(ViewData["PasswordLength"])%>位.
    </p>
    <%= Html.ValidationSummary("注册失败,请检查您的输入.") %>

    <% using (Html.BeginForm("Register", "Account", FormMethod.Post, new { id="form_register" }))
       {%>
        <div>
            <fieldset>
                <legend>账户信息</legend>
                <p>
                    <label for="username">用户名:</label>
                    <%= Html.TextBox("username", "", new { tabindex = 1 })%>
                    <%= Html.ValidationMessage("username") %>
                </p>
                <p>
                    <label for="email">Email:</label>
                    <%= Html.TextBox("email", "", new { tabindex = 2 })%>
                    <%= Html.ValidationMessage("email") %>
                </p>
                <p>
                    <label for="password">密码:</label>
                    <%= Html.Password("password", "", new { tabindex = 3 })%>
                    <%= Html.ValidationMessage("password") %>
                </p>
                <p>
                    <label for="confirmPassword">密码确认:</label>
                    <%= Html.Password("confirmPassword", "", new { tabindex = 4 })%>
                    <%= Html.ValidationMessage("confirmPassword") %>
                </p>
                <p>
                    <label for="gender">性别:</label>
                    <input type="radio" name="gender" id="gender0" tabindex="5" class="required" value="0"/><label class="inline" for="gender0">男</label>
                    <input type="radio" name="gender" id="gender1" tabindex="6" value="1"/><label class="inline" for="gender1">女</label>
                    <label for="gender" class="error">请选择您的性别.</label>
                    <%= Html.ValidationMessage("gender")%>
                </p>
                <p>
                    <label for="captcha">验证码(有几种不同的图标？):</label>
                    <input type="text" tabindex="7" name="captcha" id="captcha"/>
                    <%= Html.ValidationMessage("captcha")%>
                </p>              
                <p>
                     <button type="submit" class="submitBtn" tabindex="8" value="注  册"><span>注  册</span></button>
                </p>
            </fieldset>
        </div>
    <% } %>
</asp:Content>
